# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=wok
pkgver=3.0.0
pkgrel=5
pkgdesc="Webserver of Kimchi - a cherrypy framework for multi-purpose plug-ins"
url="https://kimchi-project.github.io/wok/"
# s390x: blocked by polkist (py3-libvirt -> libvirt -> polkit)
# riscv64: blocked by nginx
arch="noarch !s390x !riscv64"
license="Apache-2.0 AND LGPL-2.1-only"
depends="python3 nginx logrotate py3-cherrypy py3-jsonschema
	py3-pyparted  py3-ldap py3-psutil py3-m2crypto py-cheetah
	py3-augeas py3-pam py3-lxml py3-libvirt py3-yaml
	font-opensans font-awesome-free"
makedepends="automake autoconf libtool gettext-dev
	python3-dev py3-pyflakes libxslt py3-setuptools websockify py3-mock"
options="!check" # depends on jaraco
subpackages="$pkgname-lang $pkgname-doc $pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/kimchi-project/wok/archive/$pkgver.tar.gz
	wokd.initd
	alpine-specific-pushserver.patch
	alpine-specific-wokd.patch"

build() {
	sh ./autogen.sh --system
	./configure \
		--prefix=/usr \
		--sysconfdir=/etc \
		--localstatedir=/var \
		--disable-rpath
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
	install -D -m755 "$srcdir"/wokd.initd \
		"$pkgdir"/etc/init.d/wokd
}

sha512sums="d84336e4681ecf37f2625dbf4619b673e6236ef016bfc2e6b7046d4fe82c4eeb49a2223cddc94709fd24758cd5bb8a574806ef6faaaa513bc671e1c31bf5f2b6  wok-3.0.0.tar.gz
a05554686e0ea2d069a5b9e9b83f6aee678ed299269d86d1192ae417ba98fa8e727d55be8f396360c70846f549f46e64028956e5f7f5c50bbf5601f548c8bd71  wokd.initd
f257815edbd44baee4a3fbb680a8aa25a9804db1d2ef9326512dc7888c089c212d78e5b2cc7f6e28443dc64b10c7b7f4266e899570bcd2b25bc8bf6b4510a20d  alpine-specific-pushserver.patch
eb7a9f61d40d7edb11cc451ef25b6b2b920be23ddab7477798592bfe8a2bce8c3be21ac3d75b00d4ed3d2817af779799889fdd906d50039dec00c0c677d2c30c  alpine-specific-wokd.patch"
